<script src="__LAYUI__/layui.js"></script>
<link href="__LAYUI__/css/layui.css" rel="stylesheet"/>

<script>
    layui.use(['jquery', 'layer'],function () {
        alert('添加成功');
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index); //再执行关闭
        var $ = layui.$;
//        $('#back').click(function () {
//            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
//            parent.layer.close(index); //再执行关闭
//        });

    })
</script>